Conditional branch prediction using a long history

ABSTRACT

Methods and conditional branch predictors for predicting an outcome of a conditional branch instruction in a program executed by a processor using a long conditional branch history include generating a first index from a first portion of the conditional branch history and a second index from a second portion of the conditional branch history. The first index is then used to identify an entry in a first pattern history table including first prediction information; and the second index is used to identify an entry in a second pattern history table including second prediction information. The outcome of the conditional branch is predicted based on the first and second prediction information.

BACKGROUND

Many processors include a branch predictor that predicts which directionthe program flow will take in the case of instructions known to causepossible flow changes, such as branch instructions. Branch prediction isuseful as it enables instructions to be speculatively executed by theprocessor before the outcome of the branch instruction is known.

Branch instructions may be classified as conditional or indirect.Conditional branch instructions (branch instructions based on a constantvalue) require a binary decision as to whether the branch is taken ornot-taken. Indirect branch instructions (branch instructions based on avariable) require an N-ary decision as to the target address where N isthe number of possible target addresses.

Schemes for predicting the outcome of a conditional branch can becategorized into static and dynamic prediction schemes. Staticprediction schemes typically base the prediction on a static value suchas opcode or direction of the branch. Dynamic prediction schemes, on theother hand, take into account runtime behavior.

The most common dynamic branch prediction scheme is the two-leveladaptive predictor scheme which makes branch predictions based on thehistory of branches executed during the current execution of theprogram. For example, a history of the last N outcomes (taken/not-taken)of previous conditional branch instructions, referred to as thetaken/not-taken history, may be maintained. The history is then used toupdate a pattern history table (PHT) which has an entry for eachpossible pattern of the history. After a prediction is made the entry inthe PHT corresponding to the current history pattern is updated with theprediction. Then the next time that history pattern appears the sameprediction can be made.

Generally, the longer the history, the more accurate the prediction.However, as the history grows so does the PHT. In particular each bitadded to the history doubles the size of the PHT. Accordingly, there isa desire to increase conditional branch prediction accuracy by using alonger history without significantly increasing the amount ofinformation that has to be stored to make the prediction.

The embodiments described below are provided by way of example only andare not limiting of implementations which solve any or all of thedisadvantages of known branch predictors.

SUMMARY

This Summary is provided to introduce a selection of concepts in asimplified form that are further described below in the DetailedDescription. This Summary is not intended to identify key features oressential features of the claimed subject matter, nor is it intended tobe used as an aid in determining the scope of the claimed subjectmatter.

Described herein are methods and conditional branch predictors forpredicting an outcome of a conditional branch instruction using a longconditional branch history. The method comprises generating a firstindex from a first portion of the conditional branch history and asecond index from a second portion of the conditional branch history.The first index is then used to identify an entry in a first patternhistory table comprising first prediction information; and the secondindex is used to identify an entry in a second pattern history tablecomprising second prediction information. The outcome of the conditionalbranch is predicted based on the first and second predictioninformation.

A first aspect provides a method of predicting an outcome of aconditional branch instruction in a program executed by a processor, themethod comprising: generating, at a first index generation module, afirst index from a first portion of a conditional branch history, theconditional branch history comprising history information for each of aplurality of previously predicted conditional branch instructions, thefirst portion comprising a first subset of the history information inthe conditional branch history; identifying an entry in a first patternhistory table using the first index, the entry in the first patternhistory table comprising first prediction information; generating, at asecond index generation module, a second index from a second portion ofthe conditional branch history, the second portion comprising a secondsubset of the history information in the conditional branch history, thesecond subset being different from the first subset; identifying anentry in a second pattern history table using the second index, theentry in the second pattern history table comprising second predictioninformation; and predicting, using a decision logic unit, the outcome ofthe conditional branch instruction based on the first and secondprediction information.

A second aspect provides a conditional branch predictor logic unit topredict an outcome of a conditional branch instruction in a programexecuted by a processor, the conditional branch predictor logic unitcomprising: a first index generation module configured to generate afirst index from a first portion of a conditional branch history, theconditional branch history comprising history information for each of aplurality of previously predicted conditional branch instructions, thefirst portion comprising a first subset of the history information inthe conditional branch history; a second index generation moduleconfigured to generate a second index from a second portion of theconditional branch history, the second portion comprising a secondsubset of the history information in the conditional branch history, thesecond subset being different from the first subset; and a decisionlogic unit configured to: identify an entry in a first pattern historytable using the first index, the entry in the first pattern historytable comprising first prediction information; identify an entry in asecond pattern history table using the second index, the entry in thesecond pattern history table comprising second prediction information;and predict the outcome of the conditional branch instruction based onthe first and second prediction information.

A third aspect provides a processor comprising the conditional branchpredictor logic unit of the second aspect.

A fourth aspect provides a computer readable storage medium havingencoded thereon computer readable program code for generating aprocessor comprising the conditional branch predictor logic unit of thesecond aspect.

A fifth aspect provides a computer readable storage medium havingencoded thereon computer readable program code for generating aprocessor configured to perform the method of the first aspect.

The methods described herein may be performed by a computer configuredwith software in machine readable form stored on a tangible storagemedium e.g. in the form of a computer program comprising computerreadable program code for configuring a computer to perform theconstituent portions of described methods or in the form of a computerprogram comprising computer program code means adapted to perform allthe steps of any of the methods described herein when the program is runon a computer and where the computer program may be embodied on acomputer readable storage medium. Examples of tangible (ornon-transitory) storage media include disks, thumb drives, memory cardsetc. and do not include propagated signals. The software can be suitablefor execution on a parallel processor or a serial processor such thatthe method steps may be carried out in any suitable order, orsimultaneously.

The hardware components described herein may be generated by anon-transitory computer readable storage medium having encoded thereoncomputer readable program code.

This acknowledges that firmware and software can be separately used andvaluable. It is intended to encompass software, which runs on orcontrols “dumb” or standard hardware, to carry out the desiredfunctions. It is also intended to encompass software which “describes”or defines the configuration of hardware, such as HDL (hardwaredescription language) software, as is used for designing silicon chips,or for configuring universal programmable chips, to carry out desiredfunctions.

The preferred features may be combined as appropriate, as would beapparent to a skilled person, and may be combined with any of theaspects of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

Embodiments of the invention will be described, by way of example, withreference to the following drawings, in which:

FIG. 1 is a schematic diagram of a conventional two-level adaptivepredictor scheme;

FIG. 2 is a schematic diagram of a conventional skew branch predictorscheme;

FIG. 3 is a schematic diagram of a conventional YAGS (Yet Another GlobalScheme) branch prediction scheme;

FIG. 4 is a block diagram of an example single-threaded processor;

FIG. 5 is a block diagram of an example conditional branch predictorlogic unit of FIG. 4;

FIG. 6 is a block diagram of an example prediction logic unit of FIG. 5;

FIG. 7 is a schematic diagram of example conditional branch histories;

FIG. 8 is a schematic diagram of an example index generation module ofFIG. 6;

FIG. 9 is a schematic diagram of an example saturating counter;

FIG. 10 is a flowchart of an example method for predicting the outcomeof a conditional branch instruction using the conditional branchpredictor logic unit of FIG. 5;

FIG. 11 is a block diagram of an example update logic unit of FIG. 5;

FIG. 12 is a flowchart of an example method for updating the patternhistory tables of FIG. 5; and

FIG. 13 is a block diagram of an example multi-threaded processor.

Common reference numerals are used throughout the figures to indicatesimilar features.

DETAILED DESCRIPTION

Embodiments of the present invention are described below by way ofexample only. These examples represent the best ways of putting theinvention into practice that are currently known to the Applicantalthough they are not the only ways in which this could be achieved. Thedescription sets forth the functions of the example and the sequence ofsteps for constructing and operating the example. However, the same orequivalent functions and sequences may be accomplished by differentexamples.

As described above many processors include a branch predictor thatpredicts which direction the program flow will take in the case ofinstructions known to cause possible flow changes, such as branchinstructions. Branch prediction is useful as it enables instructions tobe speculatively executed by the processor before the outcome of thebranch instruction is known.

The most common dynamic conditional branch prediction scheme is thetwo-level adaptive predictor scheme which makes conditional branchpredictions based on the history of conditional branches executed duringthe current execution of the program. Such a scheme is illustrated inFIG. 1. In particular, in the two-level adaptive predictor scheme ofFIG. 1 a history of the last N outcomes (taken/not-taken) of previousconditional branch instructions, referred to as the taken/not-takenhistory 102, is maintained. The taken/not taken history 102 provides apath of how the program arrived at the conditional branch instruction.

The taken/not-taken history 102 is then used to generate an index forupdating a pattern history table (PHT) 104. In particular after aprediction is made the prediction information for the entrycorresponding to the index is updated based on the prediction. Theprediction information may comprise a single bit indicating whether thebranch was taken or not taken. In other cases the prediction informationmay comprise a saturating counter for tracking the number of times theconditional branch instruction was taken and/or not taken. The next timethat index is generated the stored prediction information can be used togenerate a prediction.

In some cases the index is generated by combining (e.g. by eitherExclusive-ORing (XORing) or by concatenating) the taken-not takenhistory 102 and the address (e.g. program counter (PC)) of theconditional branch instruction 106. Where the index is generated byXORing the taken/not-taken history 102 and the program counter of theconditional branch instruction 106, the two-level adaptive predictorscheme is referred to as GShare. Where the index is generated byconcatenating the taken/not taken history 102 and the address (e.g.program counter) of the conditional branch instruction 106 the two-leveladaptive predictor scheme is referred to as Gselect.

Generally, the longer the history (e.g. the more information in thehistory), the more accurate the prediction. However as the history growsso does the PHT. In particular, each bit added to the history doublesthe size of the PHT. Accordingly, there is a desire to increaseconditional branch prediction accuracy by using a longer history withoutsignificantly increasing the amount of information that has to be storedto make the prediction.

One method to address this has been to reduce the number of entries inthe PHT so that more than one index maps onto each entry in the PHT.This is referred to as aliasing between two indices. Aliasing can beshown to reduce prediction accuracy where two aliased indices are basedon two different sets of information. To reduce the aliasing a skewedbranch predictor scheme has been developed. This is illustrated in FIG.2. In particular, in the skewed branch predictor scheme of FIG. 2 thereduced PHT is divided into three equal PHT banks 202, 204 and 206. Ageneral index is generated by combining the entire taken/not-takenhistory 208 and the address (e.g. program counter) of the conditionalbranch instruction 210. The general index is then hashed by threedifferent functions (F1 212, F2 214, and F3 216) to produce one indexfor each PHT bank 202, 204 and 206. The prediction is then made by amajority vote 218 of the predictions from the three PHT banks 202, 204and 206. If the prediction was wrong then all of the banks are updated,but if the prediction was right only the banks that made the correctprediction are updated.

While such a scheme requires less memory to implement it tends to take along time to converge; thus the accuracy of initial predictions is quitelow.

Another scheme that has been developed to reduce the amount ofinformation that has to be stored to make a prediction is referred tothe YAGS (Yet Another Global Scheme) branch prediction scheme. Inparticular, the YAGS branch prediction scheme attempts to eliminateunnecessary information in the PHT by only storing histories that behavedifferently from the normal. The YAGs branch prediction scheme isillustrated in FIG. 3. This scheme comprises a choice PHT 302, a takencache 304 and a not-taken cache 306. The choice PHT 302 is a bi-modalpredictor (e.g. an array of two bit saturating counters) that points totaken or not-taken. The taken and not-taken caches 304 and 306 then onlystore instances when the branch does not comply with its bias.

When a conditional branch instruction occurs the address (e.g. programcounter) of the conditional branch instruction 308 is used to access thechoice PHT 302. If the choice PHT indicates the branch is taken theindex generated by the combination of the taken-not-taken history 310and the address (e.g. program counter) of the conditional branchinstruction 308 is used to access the not-taken cache 306 to see if itis a special case, where the prediction does not agree with the bias. Ifthere is a miss in the not-taken cache 306 then the choice PHT 302 isused as the prediction. Otherwise the not-taken cache 306 is used as theprediction. A similar set of events occur when the choice PHT indicatesnot-taken, but in this case the taken cache 304 is accessed to see if itis a special case where the prediction does not agree with the bias.

A cache 304 or 306 is updated if a prediction from it was used or if thechoice PHT and branch outcome do not agree.

However, the taken and not-taken caches 304 and 306 of the YAGS branchprediction scheme are fully associative structures meaning all elementsneed to be read on every access. This is only possible for small caches.If a larger predictor is needed the fully associative caches causestiming, power and area problems.

Described herein are methods and branch predictors for predicting theoutcome (taken/not-taken) of a conditional branch instruction from aconditional branch history by using different portions of theconditional branch history to identify predictions in a plurality ofpattern history tables. In particular a first portion of the conditionalbranch history is used to identify a first prediction in a primarypattern history table and a second portion of the conditional branchhistory is used to identify a second prediction in a secondary patternhistory table. The outcome then is based on the first and secondpredictions.

The methods and branch predictors described herein allow a longerhistory to be used without increasing the amount of information storedto make the prediction. In particular, by using two or more smallerpattern history tables instead of one larger pattern history table lessinformation is stored. For longer histories this allows a more accurateprediction to be made with less stored information. Also, by not usingthe cache structures of the YAGS branch prediction scheme the timing,power and area problems associated therewith are avoided.

Reference is now made to FIG. 4 which illustrates a single-threadedprocessor 400 where the outcome of a conditional branch instruction ispredicted by using different portions of the conditional branch historyto identify predictions in a plurality of pattern history tables. Theprocessor 400 comprises a fetch stage 402 configured to fetchinstructions from a program (in program order) as indicated by a programcounter (PC) and a decode and renaming stage 404 arranged to interpretthe instructions and perform register renaming.

After an instruction passes through the decode and renaming stage 404,it is (a) inserted into a re-order buffer (ROB) 406 and (b) dispatchedto pipelines 408 for execution.

The re-order buffer 406 is a buffer that enables the instructions to beexecuted out-of-order, but committed in-order. The re-order buffer 406holds the instructions that are inserted into it in program order, butthe instructions within the ROB 406 can be executed out of sequence bythe plurality of pipelines 408. In some examples, the re-order buffer406 can be formed as a circular buffer having a head pointing to theoldest instruction in the ROB 406, and a tail pointing to the youngestinstruction in the ROB 406. Instructions are output from the re-orderbuffer 406 in program order. In other words, an instruction is outputfrom the head of the ROB 406 when that instruction has been executed bythe pipelines 408, and the head is incremented to the next instructionin the ROB 406. Instructions output from the re-order buffer 406 areprovided to a commit stage 410, which commits the results of theinstructions to the register/memory.

The processor 400 also comprises a branch predictor 412, which isconfigured to predict which direction the program flow will take in thecase of instructions known to cause possible flow changes, such asbranch instructions. Branch prediction is useful as it enablesinstructions to be speculatively executed by the processor 400 beforethe outcome of the branch instruction is known. The branch predictor 412may be in communication with the fetch stage 402 and/or the pipelines408. For example, the fetch stage 402 may provide information to thebranch predictor 412 indicating which instructions are branchinstructions and may use information from the branch predictor 412 todetermine which instruction to fetch next; and the pipelines 408 mayprovide the branch predictor 412 with information indicating updates tothe program counter.

When the branch predictor 412 predicts the program flow accurately, thisimproves performance of the processor 400. However, if the branchpredictor 412 does not correctly predict the branch direction, then amis-prediction occurs which needs to be corrected before the program cancontinue. To correct a mis-prediction, the speculative instructions sentto the ROB 406 are abandoned, and the fetch stage 402 starts fetchinginstructions from the correct program branch.

The branch predictor 412 comprises an indirect branch predictor logicunit (not shown) for predicting indirect branches (branch instructionsbased on a variable) and a conditional branch predictor logic unit 414for predicting conditional branches (branch instructions based on aconstant).

The conditional branch predictor logic unit 414 predicts the outcome(taken/not-taken) of a conditional branch instruction by using differentportions of the conditional branch history to identify predictions in aplurality of pattern history tables.

Reference is now made to FIG. 5 which illustrates an example conditionalbranch predictor logic unit 414. The example conditional branchpredictor logic unit 414 of FIG. 5 comprises a plurality of patternhistory tables (PHT) 502 and 504 configured to store predictioninformation for conditional branch instructions where each table 502 and504 is indexed by a different portion of the conditional branch history506; a prediction logic unit 508 configured to predict the outcome(taken/not-taken) of a conditional branch instruction based on theprediction information in the pattern history tables 502 and 504; and anupdate logic unit 510 configured to update the prediction information inthe pattern history tables 502 and 504 after a conditional branchinstruction has been executed and the actual outcome is known.

The conditional branch history 506 is a record of previous conditionalbranch instructions. In particular the conditional branch history 506comprises history information for each of a predetermined number ofprevious conditional branch instructions. The history information maycomprise, for example, the outcome of the conditional branch instructionand/or the target address or part thereof of the conditional branchinstruction. The number of conditional branches represented in theconditional branch history 506 is referred to as the path length. Forexample, if the path length of the conditional branch history 506 isten, then the conditional branch history 506 comprises historyinformation for the ten previous conditional branch instructions. Insome cases the conditional branch history is implemented as a shiftregister. Example conditional branch histories are described withreference to FIG. 7.

In the examples described herein the conditional branch history 506 isglobal, meaning that there is only one conditional branch history 506for all conditional branch instructions. In particular the historyinformation for all conditional branch instructions is stored in thesame conditional branch history. However, in other examples, theconditional branch history 506 may be specific to a particularconditional branch instruction or to a set of conditional branchinstructions. In these examples, there may be a conditional branchhistory table comprising several conditional branch histories, one foreach particular conditional branch instruction or one for each set ofconditional branch instructions. In cases where there is one conditionalbranch history for each particular conditional branch instruction or onefor each set of conditional branch instructions, the address (or partthereof) of the conditional branch instruction may be used to selectwhich conditional branch history is used to generate the indices.

The PHTs 502 and 504, like the PHTs of FIGS. 1-3, are tables which areconfigured to store prediction information for conditional branchinstructions. In particular each entry or row of the PHT storesprediction information. The prediction information may, for example,comprise a single bit indicating the prediction (taken/not-taken). Inother cases the prediction information may comprise a saturating counterwhich indicates the prediction (taken/not-taken) and the quality of theprediction (e.g. strong or weak). An example, saturating counter isdescribed with reference to FIG. 9.

However, in contrast to the PHTs of FIGS. 1 to 3, each PHT 502 and 504is indexed by a separate portion of the conditional branch history. Thisallows the PHTs 502 and 504 to be smaller than if they were both indexedby the entire conditional branch history. For example if the conditionalbranch history comprises ten bits then a PHT indexed by the entireconditional branch history will have 2¹⁰=1024 entries. In contrast, ifsix bits of the conditional branch history are used to index a first PHT(e.g. primary PHT 502) and four bits of the conditional branch historyare used to index a second PHT (e.g. secondary PHT 504), the first PHTwill have 2⁶=64 entries and the second PHT will have 2⁴=16 entries.Therefore between the two PHTs there will be a total of 80 entries.Accordingly, indexing a plurality of tables using different portions ofthe conditional branch history 506 significantly reduces the amount ofdata that is stored compared to indexing a single table using the entireconditional branch history.

The prediction logic unit 508 is configured to generate a prediction 512for a conditional branch instruction based on the information in thePHTs 502 and 504. In particular, the prediction logic unit 508 obtainsthe conditional branch history 506 and generates an index 514 and 516for each of the PHTs. In particular, the prediction logic unit 508 usesa first portion of the conditional branch history 506 to generate afirst index 514 for the first or primary PHT 502 and a second portion(distinct from the first portion) of the conditional branch history 506to generate a second index 516 for the second or secondary PHT 504.

As described below in more detail, in some cases the conditional branchhistory 506 is divided into two portions and the portion comprising theleast significant bits is used to generate the index 514 for the primaryPHT 502 and the portion comprising the most significant bits is used togenerate the index 516 for the secondary PHT 504.

In some cases one or more of the indices is generated by combining therelevant portion of the conditional branch history with the programcounter (PC) of the conditional branch instruction being predicted 518.

Each generated index 514 and 516 is then used to identify a particularentry in the corresponding PHT 502 or 504. The prediction information520 and 522 in each entry identified by an index 514 or 516 is then usedby the prediction logic unit 508 to make a prediction 512 on the outcome(taken/not-taken) for the conditional branch instruction. As describedabove, each piece of prediction information 520 and 522 comprises aprediction. In some cases, as described in more detail below, theprediction logic unit 508 is configured to select one of the predictionsin the prediction information as the prediction for the conditionalbranch instruction using one or more criteria. The prediction 512 may besupplied to the fetch stage 402 so that it knows which instruction tofetch next.

The prediction logic unit 508 may also be configured to update theconditional branch history 506 to include the predicted outcome. Forexample, the conditional branch history may be updated so that the mostrecent outcome in the path is the predicted outcome. The predictionlogic unit 508 may also be configured to send an update to the ROB 524so that the ROB will comprise a record of the conditional branchhistory, the predicted outcome, and the table the prediction was basedon. The conditional branch history stored in the ROB reflects theconditional branch history at the time the outcome of the conditionalbranch instruction was predicted and may be referred to herein as asnapshot of the conditional branch history. This information, asdescribed below, can be used to update the PHTs after a conditionalbranch instruction has been executed and the actual outcome is known.

An example prediction logic unit 508 will be described in more detailwith reference to FIG. 6.

The update logic unit 510 is configured to receive information on anexecuted conditional branch instruction and update the PHT tables 502and 504 accordingly. For example, in some cases the update logic unit510 is configured to receive the program counter (PC) of an executedconditional branch instruction 526 and information indicating whetherthe branch was taken or not taken 528. The update logic unit 510 maythen use the program counter 526 to obtain the stored conditional branchhistory 530, the information indicating the PHT used for prediction 532from the ROB, and the predicted outcome. As described above the storedconditional branch history 530 reflects the conditional branch historyat the time the outcome of the conditional branch instruction waspredicted.

The update logic unit 510 then uses the stored conditional branchhistory 530 to generate an index 534 and 536 for each of the PHTs in asimilar manner to that used by the prediction logic unit 508 to generatethe indices 514 and 516 used for prediction. In particular, the updatelogic unit 510 uses a portion of the stored conditional branch history530 to generate a first index 534 for the first or primary PHT 502 and asecond portion (distinct from the first portion) of the storedconditional branch history 530 to generate a second index 536 for thesecond or secondary PHT 504.

Each generated index 534 and 536 is then used to identify a particularentry in the corresponding PHT 502 or 504. The prediction information538 and 540 in one or more of the entries identified by an index 534 or536 is used in conjunction with the actual outcome information 528 andthe table used for prediction 532 to generate an update 542 and 544 forone or more of the tables. As described above, each piece of predictioninformation 538 and 540 may comprise a saturating counter. In thesecases generating an update may comprise generating a new saturatingcounter value based on the actual outcome.

Once an update 542 or 544 has been generated it is written to thecorresponding PHT using the index 534 or 536 generated for that PHT 502or 504.

An example update logic unit 510 will be described in more detail belowwith reference to FIG. 11.

Reference is now made to FIG. 6 which illustrates an example predictionlogic unit 508. The prediction logic unit 508 is configured to generatea prediction 512 for a conditional branch instruction based onprediction information in two PHTs 502 and 504 wherein each of the PHTs502 and 504 is indexed based on a different portion of the conditionalbranch history.

In the example of FIG. 6, the conditional branch history 506 is dividedinto two contiguous portions 602 and 604. Each portion comprises asubset of the history information of the conditional branch history 506.A subset of a group of components is used herein to mean some, but notall of components of the group. In particular, a subset of the historyinformation of the conditional branch history comprises some of thehistory information of the conditional branch history, but not all ofthe history information of the conditional branch history.

The first portion 602 is used to generate the index 514 for the firstPHT 502 and the second portion 604 is used to generate the index 516 forthe second PHT 504. In some cases the first portion is the portion withthe least significant bits of the history and the second portion is theportion with the most significant bits of the history. The two portionsmay have the same number of bits or a different number of bits. Testinghas shown that the accuracy of the prediction may be enhanced in somecases when the first portion 602 is larger than the second portion 604(e.g. contains more history information (e.g. history information formore conditional branches) or more bits). However, the actual divisionof bits of the conditional branch history between the two portions 602and 604 may be selected based on the application in which the branchpredictor will be running. In some cases the division of bits betweenthe two portions may be selected based on testing.

The first and second portions 602 and 604 may be stored together orseparately. Where, however, the first and second portions 602 and 604are stored separately, for purposes of updating the conditional branchhistory they are treated as being one history. For example, as describedwith reference to FIG. 7, when a new conditional branch instruction hasbeen predicted the conditional branch history may be updated by shiftingall of the bits of the conditional branch history to the next highestbit in the history and adding the predicted outcome for the newconditional branch instruction to the last or least significant but inthe history. For purposes of shifting, the two portions are treated asbeing one. In particular, where the first portion encompasses the leastsignificant bits, after a new conditional branch instruction has beenpredicted, the most significant bit of the first portion is shifted tothe least significant bit of the second portion.

The prediction logic unit 508 comprises a first index generation module606 for generating the index 514 for the first PHT 502 from the firstportion 602 of the conditional branch history 506; a second indexgeneration module 608 for generating the index 516 for the second PHT502 from the second portion of the conditional branch history 506; and adecision logic unit 610 for predicting the outcome 512 for theconditional branch instruction based on the prediction information inthe PHTs 502 and 504 corresponding to the indices 514 and 516 generatedby the first and second index generation modules 606 and 608.

The first index generation module 606 is configured to generate a firstindex 514 for the first PHT 502 from the first portion 602 of theconditional branch history 506. In some cases the first index generationmodule 606 is configured to generate the first index 514 by combiningthe first portion 602 of the conditional branch history 506 and theprogram counter for the conditional branch instruction to be predicted518 or a portion thereof. The combination may be achieved using ahashing function, such as, but not limited to, an XOR function. However,other suitable combinations and/or hashing functions may be used. Anexample method for generating the index will be described with referenceto FIG. 8.

The second index generation module 608 is configured to generate asecond index 516 for the second PHT 504 from the second portion 604 ofthe conditional branch history 506. In some cases the second indexgeneration module 608 is configured to generate the second index 516 bycombining the second portion 604 of the conditional branch history 506and the program counter for the conditional branch instruction to bepredicted 518 or a portion thereof. The combination may by achievedusing a hashing function, such as, but not limited to, an XOR function.However, other suitable combinations and/or hashing functions may beused.

The decision logic module 610 is configured to receive the predictioninformation 520 and 522 from the first and second PHTs 502 and 504corresponding to the first and second indices 514 and 516 generated bythe first and second index generation modules 606 and 608 and to predictthe outcome 512 of the conditional branch instruction based on thereceived prediction information 520 and 522.

As described above, the prediction information 520 and 522 typicallycomprises a prediction (taken/not taken) and it may also compriseinformation indicating the strength of the prediction (e.g. where theprediction information is a saturating counter). Generally the decisionlogic module 610 implements a mechanism for selecting between the twopredictions if they differ. In some cases the decision logic module 610may be configured to select the prediction from the predictioninformation received from the first or primary PHT as the outputprediction 512 if the prediction is a strong prediction and otherwise tothe select the prediction from the prediction information received fromthe second or secondary PHT. In other cases, the decision logic module610 may be configured to select the prediction with the higher qualityprediction. However, other suitable methods for selecting between thepredictions received from the two PHTs may be used.

Reference is now made to FIG. 7 which illustrates example conditionalbranch histories 506. In this example the conditional branch history 506comprises a record of the predicted outcome (taken/not-taken) of the Mmost recently predicted conditional branch instructions where M is thepath length. For example, if M is five, then the conditional branchhistory 506 records the predicted outcome of the five most recentlypredicted conditional branch instructions.

The example conditional branch history 506 of FIG. 7 is twelve bits longand has a path length, M, of twelve. Accordingly, the conditional branchhistory 506 uses one bit to record the outcome (taken/not-taken) of eachof the twelve most recently predicted conditional branch instructions.In some cases a one (“1”) is used to indicate that the branch was takenand a zero (“0”) is used to indicate that the branch was not taken. Itwill be evident to a person of skill in the art that the conditionalbranch history may comprise more or fewer bits, may have a higher orlower path length (M), and may have additional information (e.g. targetaddress of part thereof) for each predicted conditional branchinstruction.

In this example, the conditional branch history 506 can be divided intotwelve blocks 702-724 where each block is a single bit that representsthe outcome of a recently predicted conditional branch. The blocks arein order of prediction of the corresponding conditional branch whereinthe left-most block (block 702) represents the outcome of the oldestpredicted conditional branch instruction in the history 506 and theright-most block (block 724) represents the outcome of the youngest (ormost recently) predicted conditional branch instruction in the history506.

In this example, the seven least significant bits (block 712-724) formthe first portion 602 of the conditional branch history and the fivemost significant bits (blocks 702-710) form the second portion 604 ofthe conditional branch history. However, it will be evident to a personof skill in the art that the two portions 602 and 604 may comprise more,fewer or different bits of the conditional branch history 506.

In some cases, the conditional branch history 506 is initially set toall zeros as shown at (a) of FIG. 7 and when the conditional branchpredictor logic unit 414 predicts the outcome of a conditional branchinstruction, the conditional branch predictor logic unit 414 shifts thedata in blocks 704-724 one bit to the left to blocks 702-722respectively and the predicted outcome for the new conditional branchinstruction is inserted into the last significant bit (block 724).

For example, if the conditional branch predictor logic unit 414 predictsthat a conditional branch will be taken (e.g. the predicted outcome is“1”) then the conditional branch predictor logic unit 414 may shift thedata “00000000000” in blocks 704-724 to blocks 702-722 respectively andinsert the predicted outcome (“1”) into block 724 so that theconditional branch history 506 contains the data “000000000001” as shownat (b) of FIG. 7.

If the conditional branch predictor logic unit 414 then subsequentlypredicts that the next conditional branch will not be taken (e.g. thepredicted outcome is “0”) then the conditional branch predictor logicunit 414 may shift the data “00000000001” in blocks 704-724 to blocks702-722 respectively and insert the predicted outcome (“0”) into block724 so that the conditional branch history 506 contains the data“000000000010” as shown at (c) of FIG. 7.

Similarly, if the conditional branch predictor logic unit 414 thensubsequently predicts that the next conditional branch will be taken(e.g. the predicted outcome is “1”) then the conditional branchpredictor logic unit 414 may shift the data “00000000010” in blocks704-724 to blocks 702-722 respectively and insert the predicted outcome(“1”) into block 724 so that the conditional branch history 506 containsthe data “000000000101” as shown at (d) of FIG. 7.

It can be seen from the examples in FIG. 7 that the two portions 602 and604 of the conditional branch history 506 are treated as being a singlehistory for purposes of updating the conditional branch history 506. Inparticular bits are shifted from one portion 602 to the other portion604 as if they are one history.

Reference is now made to FIG. 8 which illustrates an example first indexgeneration module 606 of FIG. 6. As described above with reference toFIG. 6, the first index generation module 606 receives information fromthe fetch stage 402 identifying a conditional branch instruction in theprogram. In some cases the information identifying the conditionalbranch instruction is the address (e.g. program counter) of theconditional branch instruction. The first index generation module 606then obtains the first portion 602 of the conditional branch history 506and generates an index for the first PHT 502 from the first portion 602.In some cases the first index generation module 606 is configured togenerate the first index by combining the first portion 602 of theconditional branch history 506 and the PC of the conditional branchinstruction to be predicted 518.

In the example shown in FIG. 8 the first index generation module 606performs a bit-wise exclusive-or (XOR) operation on the first portion602 of the conditional branch history 506 and a portion of the PC of theconditional branch instruction 518 to generate the first index 514. Forexample, in FIG. 8 the first index generation module 606 uses bits 2 to8 of the PC of the conditional branch instruction. Generally the indexgeneration module 606 is configured to select bits of the PC of theconditional branch instruction in the middle of the PC since the mostsignificant bits and the least significant bits have proved to provideless relevant information.

As is known to those in the art bit-wise XOR produces a “0” if the twocorresponding bits are the same and produces a “1” if the twocorresponding bits are different. For example, as shown in FIG. 8, wherethe first portion of the conditional branch history is “0101001” andbits 2 to 8 of the PC of the conditional branch instruction are“1100110” the resulting index 514 is “1001111”.

Reference is now made to FIG. 9 which illustrates an example saturatingcounter 900 which may be used in the PHTs 502 and 504 described herein.A saturating counter is a state machine with a plurality of states,wherein the number of states is based on the number of bits in thecounter. In particular, the state machine typically has 2^(X) stateswhere X is the number of bits in the counter. The first bit of thecounter indicates the prediction—e.g. whether the branch is to be takenor not. In some cases a one indicates a branch is taken and a zeroindicates the branch is not taken. The remaining bits of the counterindicate the strength of the prediction. The state machine is updatedafter the branch is taken or not taken. In some cases the saturatingcounter is incremented when the branch is taken and is decremented whenthe branch is not taken.

In the example, shown in FIG. 9 the counter has two bits thus the statemachine has s²=4 possible states “00” 902, “01” 904, “10” 906 and “11”908. The first two states “00” 902 and “01” 904 predict that the branchis not taken; and the second two states “10” 906 and “11” 908″ predictthat the branch is taken. The first and fourth states “00” 902 and “11”908 are strongly predicted whereas the second and third states “01” 904and “10” 906 are weakly predicted.

While FIG. 9 illustrates a two-bit saturating counter it will be evidentto a person of skill in the art that a saturating counter may beimplemented with more than two bits.

Reference is now made to FIG. 10 which illustrates an example method1000 for predicting the outcome of a conditional branch instructionwhich may be executed by the conditional branch predictor logic unit 414of FIGS. 4 and 5. At block 1002 the conditional branch predictor logicunit 414 receives information from the fetch stage 402 identifying aconditional branch instruction to be predicted. The informationidentifying the conditional branch instruction may be the address (e.g.program counter) of the conditional branch instruction. Once theinformation identifying the conditional branch instruction has beenreceived, the method 1000 proceeds to block 1004.

At block 1004, the conditional branch predictor logic unit 414 obtainsthe conditional branch history. Once the conditional branch history hasbeen obtained the method 1000 proceeds to blocks 1006 and 1008.

At block 1006, a first index is generated from a predetermined firstportion of the conditional branch history. In some cases the first indexis generated by combining the first portion of the conditional branchhistory with the address (e.g. program counter) of the conditionalbranch instruction or a portion thereof. Similarly, at block 1008 asecond index is generated from a predetermined second portion of theconditional branch history. The second portion is distinct from thefirst portion (e.g. the first and second portions do not comprise thesame subset of history information). As described above the secondportion may comprise the portion with the most significant bits. In somecases the second index is generated by combining the second portion ofthe conditional branch history with the address (e.g. program counter)of the conditional branch instruction or a portion thereof. Once theindices have been generated the method proceeds to block 1010 and 1012respectively.

At blocks 1010 and 1012 the indices generated in blocks 1006 and 1008are used to obtain prediction information from the first and second PHTsrespectively. The prediction information obtained from the first PHTusing the first index will be referred to as the first predictioninformation and the prediction information obtained from the second orsecondary PHT using the second index will be referred to as the secondprediction information. Once the first and second prediction informationhas been obtained the method proceeds to block 1014.

At block 1014, the outcome of the conditional branch instruction ispredicted based on the first and second prediction information. Asdescribed above prediction information comprises a prediction and mayalso comprise information indicating the strength of the prediction.Where the prediction information comprises information indicating thestrength of the prediction the relative strength of the predictions maybe used to decide which prediction is selected as the predicted outcome.In some cases the prediction of the first prediction information isfavored over the prediction of the second prediction information. Forexample, the prediction of the first prediction information may beselected as the prediction if it is a strong prediction, and otherwisethe prediction of the second prediction information may be selected asthe prediction. Once a prediction has been made the method 1000 proceedsto block 1016 where the prediction is output. Once the prediction hasbeen output the method 1000 proceeds to block 1018.

At block 1018, the re-order buffer (ROB) is updated (using theinformation identifying the conditional branch instruction) to store acopy of the conditional branch history, the predicted outcome, and thePHT used to make the prediction. This information can be used later toupdate the PHTs after the conditional branch instruction has beenexecuted and the outcome is known. Once the ROB has been updated, themethod 1000 ends.

Reference is now made to FIG. 11 which illustrates an example updatelogic unit 510. The update logic unit 510 is configured to update theprediction information in the PHTs 502 and 504 after a conditionalbranch instruction has been executed and thus the outcome is known. Inparticular the update logic unit 510 uses the conditional branch history530 stored in the ROB for the conditional branch instruction to updatethe PHTs. The stored conditional branch history 530 represents theconditional branch history at the time the outcome of the conditionalbranch instruction was predicted. The stored conditional branch history530 is divided into a first portion 1108 and a second portion 1110 inthe same manner as the conditional branch history 506 maintained by theprediction logic unit 508.

The update logic unit 510 comprises a first index generation module 1102for generating an index 534 for the first PHT 502 from the first portion1108 of the stored conditional branch history 530 (e.g. the conditionalbranch history used to predict the outcome of the conditional branchinstruction); a second index generation module 1104 for generating anindex 536 for the second PHT 504 from the second portion 1110 of thestored conditional branch history 530; and a state machine update logicunit 1106 for updating the PHTs 502 and 504 based on the actual outcomeof the conditional branch instruction.

The first index generation module 1102 is configured to generate a firstindex 534 for the first PHT 502 from the first portion 1008 of thestored conditional branch history 530. In some cases the first indexgeneration module 1102 is configured to generate the first index 534 bycombining the first portion 534 and the program counter for the executedconditional branch instruction 526 or a portion thereof. The combinationmay be achieved using a hashing function, such as, but not limited to,an XOR function. However, other suitable combinations and/or hashingfunctions may be used.

The second index generation module 1104 is configured to generate asecond index 536 for the second PHT 504 from the second portion 1110 ofthe stored conditional branch history 530. In some cases the secondindex generation module 1104 is configured to generate the second index536 by combining the second portion 1110 and the program counter for theexecuted conditional branch instruction or a portion thereof. Thecombination may by achieved using a hashing function, such as, but notlimited to, an XOR function. However, other suitable combinations and/orhashing functions may be used.

The state machine update logic unit 1106 is configured to receive theprediction information 538 and 540 corresponding to the first and secondindices 534 and 536 and to update the PHTs 502 and 504 based on theactual outcome 528 of the conditional branch instruction and theinformation indicating which table was used for prediction 532.

In some cases only the PHT that was used for prediction 532 is updated.For example, only the PHT that was used for predicted 532 may be updatedwhen the prediction was correct. By only updating the PHT that was usedfor prediction the prediction that gave the correct result isreinforced. Otherwise the path that led to the correct prediction may bealtered. In other cases both PHTs may be updated. For example, both PHTsmay be updated when the prediction was incorrect. In particular, if theprediction was incorrect or mis-predicted and there was a highconfidence in the prediction it is advantageous to update both PHTssince there has been a change in the behavior of the branch which shouldbe recorded in both PHTs.

Updating a PHT 502 or 504 may comprise generating new predictioninformation for the PHT 502 or 504 from the received predictioninformation 538 or 540 and updating the entry of the PHT 502 or 504indicated by the index 534 or 536 with the new prediction information.

Where the prediction information 538 and 540 comprises a saturatingcounter, updating the prediction information may comprise incrementingthe saturating counter if the conditional branch instruction was takenand decrementing the saturating counter if the conditional branchinstruction was not taken.

Reference is now made to FIG. 12 which illustrates a method 1200 forupdating one or more of the PHTs after a conditional branch instructionhas been executed and the actual outcome is known. The method 1200 maybe executed by the conditional branch predictor logic unit 414 of FIGS.4 and 5.

At block 1202 the conditional branch predictor logic unit 414 receivesinformation from the pipelines 408 identifying an executed conditionalbranch instruction and information indicating whether the branch wastaken or not taken. The information identifying the executed conditionalbranch instruction may be the address (e.g. program counter) of theconditional branch instruction. The information indicating whether thebranch was taken may be a single bit where a one (“1”) indicates thebranch was taken and a zero (“0”) indicates the branch was not taken.Once the information identifying the conditional branch instruction andthe information indicating whether the branch was taken or not taken hasbeen received, the method 1200 proceeds to block 1204.

At block 1204, the conditional branch predictor logic unit 414 obtainsthe stored conditional branch history, information indicating which PHTwas used for prediction, and the prediction from the ROB. In some casesthis information is obtained from the ROB using the program counter ofthe executed conditional branch instruction. As described above withrespect to FIG. 10, after the outcome of a conditional branchinstruction has been predicted the conditional branch history at thattime is stored to allow the appropriate entry of the PHT(s) to beupdated after the conditional branch instruction has been executed. Oncethe stored information has been obtained from the ROB the methodproceeds to blocks 1206 and 1208.

At block 1206, a first index is generated from a predetermined firstportion of the stored conditional branch history. In some cases thefirst index is generated by combining the first portion of the storedconditional branch history with the address (e.g. program counter) ofthe executed conditional branch instruction or a portion thereof.Similarly, at block 1208 a second index is generated from apredetermined second portion of the stored conditional branch history.The second portion is distinct from the first portion (e.g. the firstand second portions comprise a different subset of history information(i.e. history information pertaining to a different subset of previousconditional branch instructions)). In some cases the first and secondportions together form the entire stored conditional branch history. Insome cases the second index is generated by combining the second portionof the conditional branch history with the address (e.g. programcounter) of the conditional branch instruction or a portion thereof.Once the indices have been generated the method 1200 proceeds to blocks1210 and 1212 respectively.

At blocks 1210 and 1212 the indices generated in blocks 1206 and 1208are used to obtain prediction information from the first and second PHTsrespectively. The prediction information obtained from the first PHTusing the first index will be referred to as the first predictioninformation and the prediction information obtained from the second orsecondary PHT using the second index will be referred to as the secondprediction information. Once the first and second prediction informationhas been obtained the method 1200 proceeds to block 1214.

At block 1214, an update is generated for one or both of the PHTs basedon the received prediction information, the actual outcome of theconditional branch instruction and the information indicating whichtable was used for prediction. In some cases update information is onlygenerated for the PHT that was used for the prediction. In other casesupdate information may be generated for both PHTs. Where the predictioninformation comprises a saturating counter, generating an update for aPHT may comprise incrementing the saturating counter if the conditionalbranch instruction was taken and decrementing the saturating counter ifthe conditional branch instruction was not taken. Once the update orupdates has/have been generated the method 1200 proceeds to block 1216.

At block 1216, either or both of the PHTs are updated with the updateinformation generated in block 1214. For example, where updateinformation is generated for a PHT, the PHT is updated by writing theupdate information to the entry of the PHT pointed to by the indexgenerated in block 1206 or block 1208 Once the PHT(s) has/have beenupdated, the method 1200 ends.

The methods and conditional branch predictor logic units 414 describedherein may be implemented in single-threaded or multi-threaded in-orderor out of order processors.

Reference is now made to FIG. 13 which illustrates a schematic of amulti-threaded processor 1300. The processor 1300 comprises two threads1302 and 1304 which will be referred to herein as thread 0 and thread 1respectively. Each thread 1302 and 1304 comprises a fetch stage 1306 or1308, a decode and renaming stage 1310 or 1312, a re-order buffer 1314or 1316, a commit stage 1318 or 1320 and a branch predictor 1322 or 1324as described above with reference to FIG. 4. The threads 1302 and 1304share the pipelines 1326. Each branch predictor 1322 or 1324 comprises aconditional branch predictor logic unit 1328 or 1330 that predicts theoutcome of a conditional branch instruction as described above withreference to FIGS. 5 to 12.

Although the methods and conditional branch predictor logic unitsdescribed above use two PHTs, in other examples there may be more thantwo PHTs. In these cases the conditional branch history would still bedivided into two portions and one of the portions would be used to indexone table and the other index would be used to index two tables. A thirdindex, for example, may be generated by combining the relevant portionof the conditional branch history with the PC of the conditional branchinstruction in a different manner than that was used in generating thefirst or second index. The prediction information from all PHTs wouldthen be used to make a prediction.

The term ‘processor’ and ‘computer’ are used herein to refer to anydevice, or portion thereof, with processing capability such that it canexecute instructions. The term ‘processor’ may, for example, includecentral processing units (CPUs), graphics processing units (GPUs orVPUs), physics processing units (PPUs), digital signal processors(DSPs), general purpose processors (e.g. a general purpose GPU),microprocessors, any processing unit which is designed to acceleratetasks outside of a CPU, etc. Those skilled in the art will realize thatsuch processing capabilities are incorporated into many differentdevices and therefore the term ‘computer’ includes set top boxes, mediaplayers, digital radios, PCs, servers, mobile telephones, personaldigital assistants and many other devices.

Those skilled in the art will realize that storage devices utilized tostore program instructions can be distributed across a network. Forexample, a remote computer may store an example of the process describedas software. A local or terminal computer may access the remote computerand download a part or all of the software to run the program.Alternatively, the local computer may download pieces of the software asneeded, or execute some software instructions at the local terminal andsome at the remote computer (or computer network). Those skilled in theart will also realize that by utilizing conventional techniques known tothose skilled in the art that all, or a portion of the softwareinstructions may be carried out by a dedicated circuit, such as a DSP,programmable logic array, or the like.

Memories storing machine executable data for use in implementingdisclosed aspects can be non-transitory media. Non-transitory media canbe volatile or non-volatile. Examples of volatile non-transitory mediainclude semiconductor-based memory, such as SRAM or DRAM. Examples oftechnologies that can be used to implement non-volatile memory includeoptical and magnetic memory technologies, flash memory, phase changememory, resistive RAM.

A particular reference to “logic” refers to structure that performs afunction or functions. An example of logic includes circuitry that isarranged to perform those function(s). For example, such circuitry mayinclude transistors and/or other hardware elements available in amanufacturing process. Such transistors and/or other elements may beused to form circuitry or structures that implement and/or containmemory, such as registers, flip flops, or latches, logical operators,such as Boolean operations, mathematical operators, such as adders,multipliers, or shifters, and interconnect, by way of example. Suchelements may be provided as custom circuits or standard cell libraries,macros, or at other levels of abstraction. Such elements may beinterconnected in a specific arrangement. Logic may include circuitrythat is fixed function and circuitry can be programmed to perform afunction or functions; such programming may be provided from a firmwareor software update or control mechanism. Logic identified to perform onefunction may also include logic that implements a constituent functionor sub-process. In an example, hardware logic has circuitry thatimplements a fixed function operation, or operations, state machine orprocess.

Any range or device value given herein may be extended or alteredwithout losing the effect sought, as will be apparent to the skilledperson.

It will be understood that the benefits and advantages described abovemay relate to one embodiment or may relate to several embodiments. Theembodiments are not limited to those that solve any or all of the statedproblems or those that have any or all of the stated benefits andadvantages.

Any reference to an item refers to one or more of those items. The term‘comprising’ is used herein to mean including the method blocks orelements identified, but that such blocks or elements do not comprise anexclusive list and an apparatus may contain additional blocks orelements and a method may contain additional operations or elements.Furthermore, the blocks, elements and operations are themselves notimpliedly closed.

The steps of the methods described herein may be carried out in anysuitable order, or simultaneously where appropriate. The arrows betweenboxes in the figures show one example sequence of method steps but arenot intended to exclude other sequences or the performance of multiplesteps in parallel. Additionally, individual blocks may be deleted fromany of the methods without departing from the spirit and scope of thesubject matter described herein. Aspects of any of the examplesdescribed above may be combined with aspects of any of the otherexamples described to form further examples without losing the effectsought. Where elements of the figures are shown connected by arrows, itwill be appreciated that these arrows show just one example flow ofcommunications (including data and control messages) between elements.The flow between elements may be in either direction or in bothdirections.

It will be understood that the above description of a preferredembodiment is given by way of example only and that variousmodifications may be made by those skilled in the art. Although variousembodiments have been described above with a certain degree ofparticularity, or with reference to one or more individual embodiments,those skilled in the art could make numerous alterations to thedisclosed embodiments without departing from the spirit or scope of thisinvention.

The invention claimed is:
 1. A method of predicting an outcome of aconditional branch instruction in a program executed by a processor, themethod comprising: generating, at a first index generation module, afirst index from a first portion of a conditional branch history, theconditional branch history comprising history information for aplurality of previously predicted conditional branch instructions, thefirst portion comprising a first subset of the history information inthe conditional branch history; identifying an entry in a first patternhistory table using the first index, the entry in the first patternhistory table comprising first prediction information determined as afunction of the first subset of the history information in theconditional branch history, the first prediction information comprisinga first prediction and information identifying a strength of the firstprediction; generating, at a second index generation module, a secondindex from a second portion of the conditional branch history, thesecond portion comprising a second subset of the history information inthe conditional branch history, the second subset being different fromthe first subset; identifying an entry in a second pattern history tableusing the second index, the entry in the second pattern history tablecomprising second prediction information determined as a function of thesecond subset of the history information in the conditional branchhistory, the second prediction information comprising a secondprediction and information identifying a strength of the secondprediction; and predicting, using a decision logic unit, the outcome ofthe conditional branch instruction by selecting one of the firstprediction and the second prediction as the predicted outcome based onthe first and second prediction information.
 2. A conditional branchpredictor logic unit configured to predict an outcome of a conditionalbranch instruction in a program executed by a processor, the conditionalbranch predictor logic unit comprising: a first index generation moduleconfigured to generate a first index from a first portion of aconditional branch history, the conditional branch history comprisinghistory information for a plurality of previously predicted conditionalbranch instructions, the first portion comprising a first subset of thehistory information in the conditional branch history; a second indexgeneration module configured to generate a second index from a secondportion of the conditional branch history, the second portion comprisinga second subset of the history information in the conditional branchhistory, the second subset being different from the first subset; and adecision logic unit configured to: identify an entry in a first patternhistory table using the first index, the entry in the first patternhistory table comprising first prediction information determined as afunction of the first subset of the history information in theconditional branch history, the first prediction information comprisinga first prediction and information identifying a strength of the firstprediction; identify an entry in a second pattern history table usingthe second index, the entry in the second pattern history tablecomprising second prediction information determined as a function of thesecond subset of the history information in the conditional branchhistory, the second prediction information comprising a secondprediction and information identifying a strength of the secondprediction; and predict the outcome of the conditional branchinstruction by selecting one of the first prediction and the secondprediction as the predicted outcome based on the first and secondprediction information.
 3. The conditional branch predictor logic unitof claim 2, wherein the decision logic unit is further configured toselect the first prediction as the predicted outcome when theinformation identifying the strength of the first prediction indicatesthe strength of the first prediction is greater than a predeterminedthreshold.
 4. The conditional branch predictor logic unit of claim 2,wherein the decision logic unit is further configured to select thefirst prediction as the predicted outcome when the informationidentifying the strength of the first prediction and the informationidentifying the strength of the second prediction indicate the firstprediction is stronger than the second prediction.
 5. The conditionalbranch predictor logic unit of claim 2, wherein the decision logic unitis further configured to store a snapshot of the conditional branchhistory and an indication of which of the first and second predictionswas selected as the predicted outcome in association with informationidentifying the conditional branch instruction.
 6. The conditionalbranch predictor logic unit of claim 5, wherein the decision logic unitis further configured to store the snapshot of the conditional branchhistory and the indication of which of the first and second predictionswas selected as the predicted outcome in a re-order buffer.
 7. Theconditional branch predictor logic unit of claim 5, further comprisingan update logic unit configured to: receive information identifying anexecuted conditional branch instruction and information indicatingwhether the executed conditional branch was taken; and update at leastone of the first pattern history table and the second pattern historytable based on the information identifying the executed conditionalbranch instruction and the information indicating whether the executedconditional branch was taken.
 8. The conditional branch predictor logicunit of claim 7, wherein the update logic unit is further configured to:in response to receiving the information identifying the executedconditional branch instruction, obtain the snapshot of the conditionalbranch history and the indication of which of the first and secondpredictions was selected as the predicted outcome associated with theexecuted conditional branch instruction.
 9. The conditional branchpredictor logic unit of claim 8, wherein the update logic unit isfurther configured to update at least one of the first pattern historytable and the second pattern history table by: generating a third indexfrom a first portion of the snapshot of the conditional branch history;identifying an entry in the first pattern history table using the thirdindex, the entry in the first pattern history table comprising thirdprediction information; updating the third prediction information of theentry in the first pattern history table based on the informationindicating whether the executed conditional branch was taken; generatinga fourth index from a second portion of the snapshot of the conditionalbranch history; identifying an entry in the second pattern history tableusing the fourth index, the entry in the second pattern history tablecomprising fourth prediction information; and updating the fourthprediction information of the entry in the second pattern history tablebased on the information indicating whether the executed conditionalbranch was taken.
 10. The conditional branch predictor logic unit ofclaim 9, wherein the update logic unit is further configured to analyzethe indication of which of the first and second predictions was selectedas the predicted outcome to determine which of the first and secondpredictions was selected as the predicted outcome; in response todetermining that the first prediction was selected as the predictedoutcome, only update the first pattern history table; and in response todetermining that the second prediction was selected as the predictedoutcome, only update the second pattern history table.
 11. Theconditional branch predictor logic unit of claim 9, wherein each of thethird prediction information and the fourth prediction informationcomprises a saturating counter and the update logic unit is furtherconfigured to update prediction information in a pattern history tableby incrementing the saturating counter if the information indicatingwhether the executed conditional branch was taken indicates the branchwas taken, and decrementing the saturating counter if the informationindicating whether the executed conditional branch was taken indicatesthe branch was not taken.
 12. The conditional branch predictor logicunit of claim 2, wherein the first subset of history informationcomprises more information than the second subset of historyinformation.
 13. The conditional branch predictor logic unit of claim 2,wherein each of the first subset of history information and the secondsubset of history information comprises a contiguous set of information.14. The conditional branch predictor logic unit of claim 2, wherein thefirst index generation module is configured to generate the first indexby combining the first portion of the conditional branch history and anaddress of the conditional branch instruction.
 15. The conditionalbranch predictor logic unit of claim 14, wherein the first indexgeneration module is configured to combine the first portion of theconditional branch history and the address of the conditional branchinstruction by performing a hashing function on the first portion of theconditional branch history and at least a portion of the address of theconditional branch instruction.
 16. The conditional branch predictorlogic unit of claim 2, wherein the second index generation module isconfigured to generate the second index by combining the second portionof the conditional branch history and an address of the conditionalbranch instruction.
 17. The conditional branch predictor logic unit ofclaim 16, wherein the second index generation module is configured tocombine the second portion of the conditional branch history and theaddress of the conditional branch instruction by performing a hashingfunction on the second portion of the conditional branch history and atleast a portion of the address of the conditional branch instruction.18. A processor including a conditional branch predictor logic unitconfigured to predict an outcome of a conditional branch instruction ina program executed by the processor, the conditional branch predictorlogic unit comprising: a first index generation module configured togenerate a first index from a first portion of a conditional branchhistory, the conditional branch history comprising history informationfor a plurality of previously predicted conditional branch instructions,the first portion comprising a first subset of the history informationin the conditional branch history; a second index generation moduleconfigured to generate a second index from a second portion of theconditional branch history, the second portion comprising a secondsubset of the history information in the conditional branch history, thesecond subset being different from the first subset; and a decisionlogic unit configured to: identify an entry in a first pattern historytable using the first index, the entry in the first pattern historytable comprising first prediction information determined as a functionof the first subset of the history information in the conditional branchhistory, the first prediction information comprising a first predictionand information identifying a strength of the first prediction; identifyan entry in a second pattern history table using the second index, theentry in the second pattern history table comprising second predictioninformation determined as a function of the second subset of the historyinformation in the conditional branch history, the second predictioninformation comprising a second prediction and information identifying astrength of the second prediction; and predict the outcome of theconditional branch instruction by selecting one of the first predictionand the second prediction as the predicted outcome based on the firstand second prediction information.